using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

using SypConst.Garbage;
using SypEngine;
using SypEngine.SiteConfig;

namespace SypEngine
{
    public delegate void VisitorCallBack(int SiteId);

    public class SypVisitor : SypGarbageObject
    {
        protected VisitorCallBack[] Callbacks = null;
        protected readonly object _locker = new Object();
        protected bool TokenStop = false;

        public void OnTerminatedRequest() {
            lock (_locker)
            {
                this.TokenStop = true;
            }
        }

        protected bool HasTerminatedRequest()
        {
            lock (_locker)
            {
                return this.TokenStop;
            }
        }
        
        public SypVisitor(SetText WriteMethod, VisitorCallBack[] callbacks)
            : base(WriteMethod)
        {
            this.Callbacks = callbacks;
        }

        public virtual void VisitAddMethod(SypSiteHandler SiteObj, string[] parameters){}

        public virtual void VisitSupprMethod(SypSiteHandler SiteObj, string[] parameters){}

        public virtual void VisitEditMethod(SypSiteHandler SiteObj, string[] parameters){}

        

    }

}